<template>
	<view>
		<view class="imgBox" v-if='img'>
			<image :src="img" class="img" mode="widthFix"></image>
		</view>
		<mumu-camera @success='handlerSuccess' :watermark='watermark' v-else></mumu-camera>
	</view>
</template>

<script>
	import MumuCamera from '@/uni_modules/mumu-camera/components/mumu-camera/mumu-camera.vue'

	export default {
		components: {
			MumuCamera
		},
		data() {
			return {
				img: '',
				watermark: []
			}
		},
		onLoad() {

		},
		methods: {
			handlerSuccess(img) {
				this.img = img
				console.log(this.img);
				let img1 = uni.getStorageSync('img')
				if (!img1 || img1 === '') {
					console.log('img1');
					uni.setStorageSync('img', img)
				} else {
					console.log('img2');
					uni.setStorageSync('img2', img)
				}

				uni.navigateTo({
					url: '/pages/mail/confirm'
				})
			}
		}
	}
</script>

<style>
</style>